#include <cstdio>
#include <cstdlib>
char map1[10][6] = {"ling", "yi", "er", "san", "si", "wu", "liu", "qi", "ba", "jiu"};
char map2[5][6] = {"Shi", "Bai", "Qian", "Wan", "Yi"};
int print(int q, int b, int s, int a, bool isexist)
{                         //打印各级数字
    bool isnprint = true; //用于保证不重复打印ling
    if (q != 0)
    {
        printf("%s %s", map1[q], map2[2]);
        if (b != 0 || s != 0 || a != 0)
            putchar(' ');
    }
    else if (isexist && (b | s | a))
    {
        isnprint = false;
        printf("ling");
        if (b != 0 || s != 0 || a != 0)
            putchar(' ');
    }
    if (b != 0)
    {
        printf("%s %s", map1[b], map2[1]);
        if (s != 0 || a != 0)
            putchar(' ');
    }
    else if (isexist && isnprint && (s || a))
    {
        isnprint = false;
        printf("ling");
        if (s != 0 || a != 0)
            putchar(' ');
    }
    if (s != 0)
    {
        printf("%s %s", map1[s], map2[0]);
        if (a != 0)
            putchar(' ');
    }
    else if (isexist && isnprint && a)
    {
        isnprint = false;
        printf("ling");
        if (a != 0)
            putchar(' ');
    }
    if (a != 0)
        printf("%s", map1[a]);
    return 0;
}
int main()
{
    int yi = 100000000, wan = 10000, qian = 1000, bai = 100, shi = 10;
    bool isexist = false; //用于判断是否打印ling
    char c;
    c = getchar();
    if ('-' == c)
        printf("Fu ");
    else
        ungetc(c, stdin); //取消字符的读取
    char str[10] = {0};
    int len;
    while ((c = getchar()) != '\n')
    {
        str[len++] = c;
    }
    //下面把num逐步拆解
    int num = atoi(str);
    if (0 == num)//ling需要特判
        printf("ling");
    int y = num / yi;
    if (y != 0)
    { //判断输入数字大小是或否达到亿级
        isexist = true;
        printf("%s %s", map1[y], map2[4]);
        num %= yi;
        if (num != 0)
            putchar(' ');
    }
    int w = num / wan;
    if (w != 0)
    { //判断数字在万级是否有数字
        int q = w / qian;
        w %= qian;
        int b = w / bai;
        w %= bai;
        int s = w / shi;
        w %= shi;
        print(q, b, s, w, isexist);
        printf(" Wan");
        num %= wan;
        if (num != 0)
            putchar(' ');
        isexist = true;
    }
    int q = num / qian;
    num %= qian;
    int b = num / bai;
    num %= bai;
    int s = num / shi;
    num %= shi;
    print(q, b, s, num, isexist);
    putchar('\n');
    return 0;
}